/**
 * Note: The returned array must be malloced, assume caller calls free().
 */
int* singleNumber(int* nums, int numsSize, int* returnSize) {
    int ret=0;
    for(int i=0;i<numsSize;i++){
        ret^=nums[i];
    }
    int m=0;
    while(m<32){
        if(ret&(1<<m)){
            break;
        }
        else{
            ++m;
        }
    }
    int x1=0;
    int x2=0;
    for(int i=0;i<numsSize;i++){
        if(nums[i]&(1<<m)){
            x1^=nums[i];
        }
        else{
            x2^=nums[i];
        }
    }
    int *reArr=(int *)malloc(sizeof(int)*2);
    reArr[0]=x1;
    reArr[1]=x2;
    *returnSize=2;
    return reArr;
}